package com.cheney.demo.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.cheney.common.core.model.BaseModel;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author si.chen
 * @date 2021/1/1 13:14
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("test_user")
public class TestUser extends BaseModel {

    private static final long serialVersionUID = 607926508651977946L;

    @TableId(type = IdType.AUTO)
    private Integer id;

    private String name;

    private String sex;

    private Integer age;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    private BigDecimal amount;

    public TestUser() {
    }

    public TestUser(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public TestUser(String name) {
        this.name = name;
    }

    public TestUser(String name, Integer age) {
        this.name = name;
        this.age = age;
    }

    public TestUser(String name, Date createTime) {
        this.name = name;
        this.createTime = createTime;
    }

    public TestUser(String name, BigDecimal amount) {
        this.name = name;
        this.amount = amount;
    }
}
